package sharedServlets;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import model.MailingManager;

public class ContactSynca extends HttpServlet{
	@Override
	protected void doPost(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException {
		String name = req.getParameter("name");
		String email = req.getParameter("email");
		String subject = req.getParameter("subject");
		String content = req.getParameter("content");
		String ie = req.getParameter("brows");
		System.out.println("Contact Synca");
		if(name!=null && email!=null && subject!=null && content!=null && 
				!name.equals("") && !email.equals("") && !subject.equals("") && !content.equals("")){
			MailingManager mailingManager = MailingManager.getInst();
			mailingManager.contactSynca(name,email,subject,content);
		}
		System.out.println("After Contact Synca");
		resp.sendRedirect("home.jsp");
	}
}
